package com.mo.controller;

import com.mo.result.NameValue;
import com.mo.result.R;
import com.mo.service.StatisticService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author mo
 * version
 */
@RestController
public class StatisticController {

    @Resource
    private StatisticService statisticService;

    @GetMapping(value = "/api/summary/data")
    public R loadSummaryData() {
       return R.OK(statisticService.loadSummaryData()) ;
    }

    @GetMapping(value = "/api/saleFunnel/data")
    public R saleFunnelData(){
     List<NameValue> nameValueList= statisticService.loadSaleFunnelData();
     return R.OK(nameValueList);
    }
    @GetMapping(value = "/api/sourcePie/data")
    public R sourcePieData(){
     List<NameValue> nameValueList= statisticService.loadSourcePieData();
     return R.OK(nameValueList);
    }
}
